package org.chen.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@TableName("video_article")
public class Article implements Serializable {
    
    @TableId(type = IdType.ASSIGN_ID)
    private String id;
    
    @TableField(condition = SqlCondition.LIKE)
    private String title;

    @TableField(condition = SqlCondition.LIKE)
    private String description;
    
    private String url;
    
    private String source;

    private String category;

    private String categoryId;    // 分类ID

    private String categoryPath;  // 分类路径

    /**
     * 状态：0-未处理 1-处理中 2-已完成 3-失败
     */
    private Integer status;
    
    @CreatedDate
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    @LastModifiedDate
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime articleTimestamp;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime importTimestamp;
    
    @Version
    @TableField(fill = FieldFill.INSERT)
    private Integer version;
}